springboot中如何实现默认静态路径

您所在的位置:网站首页 springboot css路径 springboot中如何实现默认静态路径

springboot中如何实现默认静态路径

#springboot中如何实现默认静态路径| 来源: 网络整理| 查看: 265

类ResourceProperties.class

private static final String[] CLASSPATH_RESOURCE_LOCATIONS = new String[]{"classpath:/META-INF/resources/", "classpath:/resources/", "classpath:/static/", "classpath:/public/"}; private String[] staticLocations; public ResourceProperties() { this.staticLocations = CLASSPATH_RESOURCE_LOCATIONS; this.addMappings = true; this.chain = new ResourceProperties.Chain(); this.cache = new ResourceProperties.Cache(); }登录后复制

根据构造方法可知, staticLocations等于默认的CLASSPATH_RESOURCE_LOCATIONS, 也即"classpath:/META-INF/resources/", "classpath:/resources/", "classpath:/static/", "classpath:/public/"

classpath即为我们如下图所示的resource文件夹

springboot中如何实现默认静态路径

以上就是springboot中如何实现默认静态路径的详细内容,更多请关注php中文网其它相关文章!



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3